//Localizer Singleton
//Maintaining a single instance through out the Project


using System;
using System.Reflection;
using System.Resources;
using System.Globalization;
using System.Threading;

namespace Rally_Dekstop
{
    public sealed class Localizer
    {
        private static Localizer instance = null;
        private ResourceManager m_resourceManager;
        private static readonly object padlock = new object(); 

        private Localizer()
        {
            m_resourceManager = new ResourceManager("Rally_Dekstop.Localizer", System.Reflection.Assembly.GetExecutingAssembly());
        }

        /// <summary>
        /// This method gives the user access to this Localizer singleton 
        /// </summary>
        /// <returns></returns>
        public static Localizer getInstance()
        {
            lock (padlock)
            {
                if (instance == null)
                {
                    instance = new Localizer();
                }
                return instance;
            }
        }

        /// <summary>
        /// This method returns the only instance created for ResourceManager 
        /// </summary>
        /// <returns></returns>
        public ResourceManager GetResourceManager()
        {
            return m_resourceManager;
        }
    }
}
